package jwj8508.mvc.actions;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import jwj8508.mvc.dao.BoardDAO;

public class ViewBoardAction implements ActionHandler {

	@Override
	public String execute(HttpServletRequest req, HttpServletResponse res)
			throws ServletException, IOException {
		String viewPage = "f|/WEB-INF/jsp/tiles/mvc.jsp";
		req.setAttribute("action", "../board/view.jsp");
		String bdno = req.getParameter("bdno");
		BoardDAO.viewCountBoard(bdno);
		req.setAttribute("b", BoardDAO.viewBoard(bdno));
		
		return viewPage;
	}

}
